<template>
	<view class="outsize">
		<view
			style="display: flex;justify-content: space-around;margin-bottom: 10px;padding-top: 17px;font-size: 18px;">
			<view style="display: flex;">
				分享收益：<view style="color: crimson;margin-right: 5px;">
					0
				</view> 元
			</view>
			<view style="display: flex;">
				可提现金额：<view style="color: crimson;margin-right: 5px;">
					0
				</view> 元
			</view>
		</view>
		<view v-for="(item,index) in substance[0]" :key="index" style="margin-bottom: 9px;">
			<view class="cycle">
				<view class="cycleUp">
					<view class="upUp">
						交易流水
					</view>
					<view class="upRight" style="">
						<!-- 2024-1212 08:00 -->
						{{item.orgSubTrace}}
					</view>
				</view>
				<!-- <view class="cycleUp">
					<view class="upUp">
						交易流水
					</view>
					<view class="upRight">
						{{item.orgSubTrace}}
					</view>
				</view> -->
				<view class="cycleUp">
					<view class="upUp" style="width: 115px;">
						订单成本金额
					</view>
					<view class="upRight" style="width: calc(100vw - 170px);text-align: right;">
						{{item.feeCostAmt}} 分
					</view>
				</view>
				<view class="cycleUp">
					<view class="upUp" style="width: 115px;">
						订单分账金额
					</view>
					<view class="upRight" style="width: calc(100vw - 170px);text-align: right;">
						{{item.subtransAmt}} 分
					</view>
				</view>
				<view class="cycleUp">
					<view class="upUp">
						原交易日期
					</view>
					<view class="upRight">
						{{item.oriBizDate.substring(0,4)}}年{{item.oriBizDate.substring(4,6)}}月{{item.oriBizDate.substring(6,8)}}日
					</view>
				</view>
				<u-empty v-if="substance.length==0" mode="data" icon="/static/index/homeowner/history.png">
				</u-empty>
			</view>
		</view>
	</view>
</template>

<script setup>
	import {
		onShow
	} from '@dcloudio/uni-app'
	import {
		reactive,
		ref
	} from 'vue';
	import {
		get,
		post
	} from '../../serve/method';
	const userId = ref()
	const substance = reactive([])
	onShow(() => {
		console.log('坎坎坷坷靠')
		substance.length = 0
		uni.getStorage({
			key: 'lifeData',
			success(data) {
				console.log(data.data.vuex_user.userId)
				userId.value = data.data.vuex_user.userId
				let url = `/api/system/account/selectMyEarnings/${userId.value}`
				// let url = `/api/system/account/selectMyEarnings/54`
				get(url).then((res) => {
					substance.push(res.data)
					console.log(substance, 77777777777777777777)
				})
			}
		})
	})
</script>

<style scoped lang="scss">
	.outsize {
		background: linear-gradient(to bottom, #FFF7D0, #f2f2f2);
		width: 100vw;
		height: calc(100vh - 20px);
		overflow-y: scroll;
		padding: 10px 0;
	}

	.cycle {
		width: calc(100vw - 40px);
		margin: 0 auto;
		background-color: #ffffff;
		border-radius: 10px;
		padding: 1px 10px;

		.cycleUp {
			display: flex;
			margin: 15px 0;

			.upUp {
				color: #999999;
			}

			.upRight {
				margin-left: auto;
				font-size: 13px;
			}
		}
	}
</style>